<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>mainPanel</title>
    <script type="text/javascript" language="javascript" src="gwtgigmissions/gwtgigmissions.nocache.js"></script>
  </head>

  <body>
    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
	<%
    UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    if (user != null) {
	%>
	<p>Hello <%= user.getNickname() %>,<a href="<%= userService.createLogoutURL(request.getRequestURI()) %>">sign out</a></p>
	<%
    } else {
	%>
	<p><a href="<%= userService.createLoginURL(request.getRequestURI()) %>">Sign in</a>	to add gigs.</p>
	<%
    }
	%>

   <form action="/putgig" method="post">
    <div>Title:<input name="title" type="textbox"/></div>
    <div>Address:<input name="address" type="textbox"/></div>
    <div>Lat:<input name="lat" type="textbox"/></div>
    <div>Long:<input name="lng" type="textbox"/></div>
    <div>Date:<input name="date" type="textbox"/></div>
    <div>Time:<input name="time" type="textbox"/></div>
    <div>Description<textarea name="description" rows="3" cols="60"></textarea></div>
    <div><input type="submit" value="Post Gig" /></div>
   </form>

	
  </body>
</html>